
#ifndef __CE_BOUNDINGBOXBUILDER_H__
#define __CE_BOUNDINGBOXBUILDER_H__

#include <export.h>
#include <gfx/ivertexbuffer.h>
#include <gfx/ivertexdeclaration.h>
#include <math/boundingbox.h>

/**
 * \addtogroup utils
 * @{
 */

/**
 * @brief Utility class for building bounding boxes from vertex buffers.
 */
class CE_API ceBoundingBoxBuilder
{
private:
	iVertexBuffer*	_vb;
	char*						_data;
	unsigned				_stride;
public:
  ceBoundingBoxBuilder ();
  ~ceBoundingBoxBuilder ();
	bool Initialize (iVertexBuffer* vb, iVertexDeclaration* vd);
	void Close ();

	ceBoundingBox CreateBoundingBox (unsigned numVertices);
	ceBoundingBox CreateBoundingBox (unsigned numIndices, unsigned short* indices);
	ceBoundingBox CreateBoundingBox (unsigned numIndices, unsigned* indices);
	ceBoundingBox CreateBoundingBox (unsigned offset, unsigned stride, unsigned numP, unsigned numQ);
};

/** @} */

#endif /* ! __CE_BOUNDINGBOXBUILDER_H__ */

